package com.ls.stream;

import java.io.UnsupportedEncodingException;

import org.apache.log4j.Logger;

import com.google.common.base.Preconditions;

public class EStringUtils {
	private static Logger logger =Logger.getLogger(EStringUtils.class);
	public static String getString(byte[] bytes){
		Preconditions.checkNotNull(bytes);
		try {
			return new String(bytes,EConstants.CHARSET);
		} catch (UnsupportedEncodingException e) {
			throw new RuntimeException(e);
		}
	}
	
	public static byte[] getBytes(String str){
		Preconditions.checkNotNull(str);
		try {
			return str.getBytes(EConstants.CHARSET);
		} catch (UnsupportedEncodingException e) {
			throw new RuntimeException(e);
		}
	}
	
	
}
